package com.xqboss.apps.dto.box;

import com.xqboss.apps.dto.PageDto;
import com.xqboss.apps.enums.box.BoxSequenceEnum;
import com.xqboss.apps.enums.nft.NftTypeEnum;
import com.xqboss.apps.enums.nft.ResellEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 箱子
 *
 * @author wangcong
 * @date 2023-08-23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel("箱子dto")
public class BoxDto extends PageDto {

    @ApiModelProperty("箱子id")
    private Long id;

    @ApiModelProperty("箱子名称")
    private String name;

    @ApiModelProperty("标签id")
    private Long categoryId;

    @ApiModelProperty("分类id")
    private Long categoryNftId;

    @ApiModelProperty("公告id")
    private Long announcementId;

    @ApiModelProperty("作者id")
    private Long authorId;

    @ApiModelProperty("作者名称")
    private String authorName;

    @ApiModelProperty("作者头像")
    private String authorHeadimg;

    @ApiModelProperty("发行方id")
    private Long publishId;

    @ApiModelProperty("发行方名称")
    private String publishName;

    @ApiModelProperty("发行方头像")
    private String publishHeadimg;

    @ApiModelProperty("箱子图片")
    private String headimg;

    @ApiModelProperty("背景图")
    private String bgimg;

    @ApiModelProperty("历史活动图片")
    private String activityImg;

    @ApiModelProperty("是否绑定 0否，1是")
    private Integer status;

    @ApiModelProperty("发售价格")
    @DecimalMin(value = "0", message = "最小值为0")
    private BigDecimal price;

    @ApiModelProperty("最低价")
    @DecimalMin(value = "0", message = "最小值为0")
    private BigDecimal lowestPrice;

    @ApiModelProperty("最高价")
    private BigDecimal maxPrice;

    @ApiModelProperty("开箱消耗热豆")
    private BigDecimal openHotBeans;

    /**
     * 转卖开关（0关闭，1开启）
     */
    private ResellEnum isResell;

    @ApiModelProperty("自动开箱（0否，1是）")
    private Boolean autoOpen;

    @ApiModelProperty("箱子类型：1藏品箱子,2装备箱子")
    private NftTypeEnum type;

    @ApiModelProperty("开始发售时间")
    private LocalDateTime publishTimeStart;

    @ApiModelProperty("结束发售时间")
    private LocalDateTime publishTimeEnd;

    @ApiModelProperty("详情")
    private String description;

    @ApiModelProperty("外显库存(发售总量)")
    @Min(value = 0, message = "最小值为0")
    private Integer displayStock;

    @ApiModelProperty("限购数量（列表查询：0不限，1限购）")
    @Min(value = 0, message = "最小值为0")
    private Integer limitStock;

    @ApiModelProperty("单次限购数量")
    @Min(value = 0, message = "最小值为0")
    private Integer onceLimitStock;

    @ApiModelProperty("购买说明")
    private String buyExplain;

    @ApiModelProperty("1随机发，2顺序发")
    private BoxSequenceEnum sequence;

    @ApiModelProperty("箱子绑定的nft列表")
    @Valid
    private List<BindBoxDto> bindNft;

    @ApiModelProperty("冷却时间(分钟)")
    private Integer coolingTime;

    @ApiModelProperty("是否置顶 0否，1是")
    private Integer isTop;

    @ApiModelProperty("是否有库存 0否，1是")
    private Integer stock;

    @ApiModelProperty("搜索关键字")
    private String keyword;

}